import React, { Component } from 'react'

let HigherComponent = (WrappedComponent)=> {
  return class extends Component{
    constructor(props){
      super(props)
      this.state = {
        msg: '🐂'
      }
    }
    handleClick = ()=> {
      console.log('clicked')
    }
    render() {
      return <WrappedComponent msg={this.state.msg} handleClick={this.handleClick}></WrappedComponent>
    }
  }
}

class App extends Component {
  render() {
    return (
      <div>
        <h1>App 组件</h1>
      </div>
    )
  }
}

export default HigherComponent(App)
